home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{41697034-C21B-11D2-ACDB-444553540000}#1.0#0"; "PING.OCX"
- Begin VB.Form PingForm
- Caption = "Ping ActiveX Control Demo"
- ClientHeight = 6090
- ClientLeft = 60
- ClientTop = 375
- ClientWidth = 9420
- LinkTopic = "Form1"
- ScaleHeight = 6090
- ScaleWidth = 9420
- StartUpPosition = 3 'Windows Default
- Begin Ping_ActiveX_Control.Ping Ping1
- Left = 4680
- Top = 840
- _ExtentX = 529
- _ExtentY = 529
- End
- Begin VB.TextBox RoundTripTimeText
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 8400
- TabIndex = 27
- Top = 1800
- Width = 855
- End
- Begin VB.TextBox LastIPScan
- BackColor = &H00E0E0E0&
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 8640
- TabIndex = 25
- Top = 5400
- Width = 495
- End
- Begin VB.TextBox Text2
- BackColor = &H00E0E0E0&
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 7440
- TabIndex = 24
- Text = "202.159.32."
- Top = 5400
- Width = 1215
- End
- Begin VB.TextBox Text1
- BackColor = &H00E0E0E0&
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 3240
- TabIndex = 22
- Text = "202.159.32."
- Top = 4680
- Width = 1215
- End
- Begin VB.ListBox UserList
- Height = 1815
- Left = 6000
- TabIndex = 21
- Top = 3360
- Width = 3255
- End
- Begin VB.CommandButton ScanCommand
- Caption = "Scan"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 495
- Left = 240
- TabIndex = 20
- Top = 5280
- Width = 5295
- End
- Begin VB.TextBox IPto
- BackColor = &H00E0E0E0&
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 4680
- TabIndex = 19
- Text = "159"
- Top = 4680
- Width = 495
- End
- Begin VB.TextBox IPfrom
- BackColor = &H00E0E0E0&
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 1920
- TabIndex = 17
- Text = "2"
- Top = 4680
- Width = 495
- End
- Begin VB.TextBox IP
- BackColor = &H00E0E0E0&
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 480
- TabIndex = 16
- Text = "202.159.32."
- Top = 4680
- Width = 1215
- End
- Begin VB.TextBox EchoDataText
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 8400
- TabIndex = 13
- Top = 1440
- Width = 855
- End
- Begin VB.TextBox DataSizeText
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 8400
- TabIndex = 12
- Top = 1080
- Width = 855
- End
- Begin VB.TextBox PingingDataText
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 8400
- TabIndex = 11
- Top = 720
- Width = 855
- End
- Begin VB.TextBox TimeOutText
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 8400
- TabIndex = 10
- Top = 360
- Width = 855
- End
- Begin VB.CommandButton StopCommand
- Caption = "S t o p"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 735
- Left = 4320
- TabIndex = 4
- Top = 2880
- Width = 1455
- End
- Begin VB.TextBox HostIP
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 1800
- TabIndex = 3
- Top = 240
- Width = 3495
- End
- Begin VB.CommandButton PingCommand
- Caption = "Pinging Host"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 735
- Left = 4320
- TabIndex = 2
- Top = 1560
- Width = 1455
- End
- Begin VB.TextBox StatusText
- Height = 2415
- Left = 120
- MultiLine = -1 'True
- ScrollBars = 3 'Both
- TabIndex = 0
- Top = 1440
- Width = 4095
- End
- Begin VB.Label Label13
- BorderStyle = 1 'Fixed Single
- Caption = " Scanning "
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 6240
- TabIndex = 29
- Top = 5400
- Width = 1215
- End
- Begin VB.Label Label8
- BorderStyle = 1 'Fixed Single
- Caption = " Date Size, Echo Data, Round Trip Time are READ ONLY"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 495
- Left = 6240
- TabIndex = 28
- Top = 2280
- Width = 3015
- End
- Begin VB.Label Label2
- BorderStyle = 1 'Fixed Single
- Caption = " Round Trip Time"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 6240
- TabIndex = 26
- Top = 1800
- Width = 2175
- End
- Begin VB.Label Label12
- Alignment = 2 'Center
- BackColor = &H00000000&
- Caption = "List Of Active IP"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H0000FF00&
- Height = 255
- Left = 6000
- TabIndex = 23
- Top = 3120
- Width = 3255
- End
- Begin VB.Line Line7
- BorderColor = &H00E0E0E0&
- X1 = 9360
- X2 = 0
- Y1 = 6000
- Y2 = 6000
- End
- Begin VB.Line Line6
- X1 = 9360
- X2 = 0
- Y1 = 5880
- Y2 = 5880
- End
- Begin VB.Line Line5
- X1 = 6000
- X2 = 9480
- Y1 = 2880
- Y2 = 2880
- End
- Begin VB.Line Line2
- BorderColor = &H00E0E0E0&
- X1 = 6000
- X2 = 6000
- Y1 = 0
- Y2 = 2880
- End
- Begin VB.Line Line1
- X1 = 5880
- X2 = 5880
- Y1 = 0
- Y2 = 3960
- End
- Begin VB.Label Label11
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "To IP Address :"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 3000
- TabIndex = 18
- Top = 4200
- Width = 2535
- End
- Begin VB.Label Label10
- Alignment = 2 'Center
- BorderStyle = 1 'Fixed Single
- Caption = "From IP Address :"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 240
- TabIndex = 15
- Top = 4200
- Width = 2535
- End
- Begin VB.Label Label9
- Alignment = 2 'Center
- BackColor = &H00000000&
- Caption = " Pinging Status "
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H0000FF00&
- Height = 255
- Left = 1080
- TabIndex = 14
- Top = 1200
- Width = 2175
- End
- Begin VB.Label Label7
- BorderStyle = 1 'Fixed Single
- Caption = " Echo Data"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 6240
- TabIndex = 9
- Top = 1440
- Width = 2175
- End
- Begin VB.Label Label6
- BackColor = &H00000000&
- Caption = " Ping Packet Parameter"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H0000FF00&
- Height = 255
- Left = 6240
- TabIndex = 8
- Top = 120
- Width = 3015
- End
- Begin VB.Line Line3
- X1 = 0
- X2 = 5880
- Y1 = 3960
- Y2 = 3960
- End
- Begin VB.Label Label5
- BorderStyle = 1 'Fixed Single
- Caption = " Time Out "
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 6240
- TabIndex = 7
- Top = 360
- Width = 2175
- End
- Begin VB.Label Label4
- BorderStyle = 1 'Fixed Single
- Caption = " Pinging Data "
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 6240
- TabIndex = 6
- Top = 720
- Width = 2175
- End
- Begin VB.Label Label3
- BorderStyle = 1 'Fixed Single
- Caption = " Data Size"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 6240
- TabIndex = 5
- Top = 1080
- Width = 2175
- End
- Begin VB.Label Label1
- BorderStyle = 1 'Fixed Single
- Caption = " Host IP Address :"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 120
- TabIndex = 1
- Top = 240
- Width = 1695
- End
- Attribute VB_Name = "PingForm"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub HostIP_Change()
- Ping1.IPAddress = HostIP.Text
- End Sub
- Private Sub PingCommand_Click()
- '
- PingCommand.Enabled = False
- Ping1.IPAddress = RTrim(HostIP.Text)
- Ping1.PingHost = True
- ' Sleep for a while
- GoToSleep (Val(TimeOutText.Text))
- If Ping1.Error Then
- Ping1.PingHost = False
- Exit Sub
- End If
- StatusText.Text = Ping1.PingingStatus
- DataSizeText.Text = Str(Ping1.DataSize)
- EchoDataText.Text = Ping1.EchoData
- RoundTripTimeText.Text = Str(Ping1.RoundTripTime)
- PingCommand.Enabled = True
- Exit Sub
- '
- End Sub
- Private Sub PingingDataText_Change()
- Ping1.PingingData = PingingDataText.Text
- End Sub
- Private Sub ScanCommand_Click()
- ScanCommand.Enabled = False
- PingCommand.Enabled = False
- Dim IPTest As Integer
- StatusText.Text = ""
- For IPTest = Val(IPfrom.Text) To Val(IPto.Text)
- DoEvents
- If ScanCommand.Enabled = True Then
- Exit Sub
- End If
- Ping1.IPAddress = IP.Text & Str(IPTest)
- Ping1.PingingData = Str(IPTest)
- PingingDataText.Text = Str(IPTest)
- LastIPScan.Text = Str(IPTest)
- Ping1.PingHost = True
- StatusText.Text = StatusText.Text + "Pinging to : " & IP.Text & Str(IPTest) + vbCrLf
- StatusText.Text = StatusText.Text + Ping1.PingingStatus + vbCrLf
- ' Sleep for a while
- GoToSleep (Val(TimeOutText.Text))
- ' If don't have error means the IP address is available
- If Ping1.Error = False Then
- ' To add the IP List...
- ' Echo Data must be equal with Pinging Data
- If Ping1.EchoData = Ping1.PingingData Then
- UserList.AddItem IP.Text & Str(IPTest)
- StatusText.Text = StatusText.Text + Ping1.PingingStatus + vbCrLf
- DataSizeText.Text = Str(Ping1.DataSize)
- EchoDataText.Text = Ping1.EchoData
- RoundTripTimeText.Text = Str(Ping1.RoundTripTime)
- End If
- Else
- StatusText.Text = StatusText.Text + Ping1.PingingStatus + vbCrLf
- Ping1.PingHost = False
- Ping1.IPAddress = IP.Text & Str(IPTest + 1)
- End If
- Next IPTest
- ScanCommand.Enabled = True
- PingCommand.Enabled = True
- End Sub
- Private Sub StopCommand_Click()
- Ping1.PingHost = False
- ScanCommand.Enabled = True
- PingCommand.Enabled = True
- End Sub
- Private Sub TimeOutText_Change()
- Ping1.TimeOut = TimeOutText.Text
- End Sub
-